const path = require("path");

function resolve(dir) {
  return path.join(__dirname, dir);
}
module.exports = {
  devServer: {
    //配置代理
    proxy: {
      "/VueHandler": {
        target: "http://localhost:3000", //目标服务器地址
        ws: true,
        changeOrigin: true, //允许跨域
        pathRewrite: {
          "^/VueHandler": "/",
        },
      },
    },
  },
  configureWebpack: {
    //文件夹别名
    devtool: "source-map",
    resolve: {
      alias: {
        "@": resolve("src"),
        "@com": "@/components",
        "@utils": "@/utils",
        "@views": "@/views",
        "@assets": "@/assets",
      },
    },
  },
};
